package com.dxy.dxyuser.controller;

import com.dxy.dxycommon.VO.ResultVO;
import com.dxy.dxycommon.VO.UserInfoVO;
import com.dxy.dxycommon.utils.ResultVOUtil;
import com.dxy.dxyuser.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * junfeng 2018/11/1 注册
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class RegisterController {

    @Autowired
    private UserInfoService userInfoService;

    /**
     * 注册
     *
     * @param userInfoVO
     * @return
     */
    @RequestMapping(value = "/register", consumes = "application/json")
    public ResultVO register(@RequestBody UserInfoVO userInfoVO) {
        userInfoService.addUserInfo(userInfoVO);
        return ResultVOUtil.success();
    }

}
